package com.sqlist.share;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;

import com.sqlist.share.connection.Client;
import com.sqlist.share.dto.MessageDTO;
import com.sqlist.share.util.Callback;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by SqList on 2018/6/15.
 */

public class NettyService extends Service {

    private static final String TAG = "Share - NettyService";

    private Client client;

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        client = Client.getInstance();

        new Thread(new Runnable() {
            @Override
            public void run() {
                client.connect();
            }
        }).start();

        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        client.disConnect();
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
